package com.heima.reggie.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.reggie.domain.DishFlavor;
import com.heima.reggie.service.DishFlavorService;
import com.heima.reggie.mapper.DishFlavorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author liulanhui
* @description 针对表【dish_flavor(菜品口味关系表)】的数据库操作Service实现
* @createDate 2023-01-03 16:38:10
*/
@Service
public class DishFlavorServiceImpl extends ServiceImpl<DishFlavorMapper, DishFlavor>
    implements DishFlavorService {

    @Autowired
    DishFlavorMapper dishFlavorMapper;

    @Override
    public List<DishFlavor> getDishFlavorByDishId(Long dishId) {
        List<DishFlavor> dishFlavors = dishFlavorMapper.selectAllByDishId(dishId);
        return dishFlavors;
    }

    @Override
    public void deleteByDishId(Long dishId) {
        dishFlavorMapper.deleteByDishId(dishId);
    }

    @Override
    public void deleteByDishIdIn(List<Long> longs) {
        dishFlavorMapper.deleteByDishIdIn(longs);
    }
}




